//
//  YWMaterialApply.m
//  maintain
//
//  Created by 烟雨云渊 on 16/9/2.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWMaterialApply.h"
#import "YWHandler.h"
#import "YWCommonTool.h"


@implementation YWMaterialApply
+ (NSArray *)mj_ignoredPropertyNames
{
    return @[@"replies"];
}
+ (NSDictionary*)mj_objectClassInArray
{
    return @{@"details" : @"YWMaterialApplyDetail",
             @"creator" : @"YWHandler",
             @"recipients" : @"YWHandler",
             @"observers" : @"YWHandler",
             @"rejectUser" : @"YWHandler"};
}
- (void)mj_keyValuesDidFinishConvertingToObject{
    NSMutableString *ids = [[NSMutableString alloc] init];
    [self.recipients enumerateObjectsUsingBlock:^(YWHandler*  _Nonnull handler, NSUInteger idx, BOOL * _Nonnull stop) {
        if (idx!=0) {
            [ids appendString:@","];
        }
        [ids appendString:[@(handler.uniqueId) stringValue]];
    }];
    self.receiverIds = [NSString stringWithFormat:@"%@",ids];
    
    NSMutableString *copyids = [[NSMutableString alloc] init];
    [self.observers enumerateObjectsUsingBlock:^(YWHandler*  _Nonnull handler, NSUInteger idx, BOOL * _Nonnull stop) {
        if (idx!=0) {
            [copyids appendString:@","];
        }
        [copyids appendString:[@(handler.uniqueId) stringValue]];
    }];
    self.carbonCopyIds = [NSString stringWithFormat:@"%@",copyids];
    self.yearMonthDay = [YWCommonTool  showChineseFormatterDate:self.applyTime/1000];
}
@end

//@implementation YWMaterialScanReceipientJson
//
//
//@end

@implementation YWMaterialScanReturnJson
+ (NSDictionary*)mj_objectClassInArray
{
    return @{@"materialCirculationInfos" : @"YWMaterialCirculation"};
}
@end

@implementation YWMaterialApplyViewModel


@end

@implementation YWMaterialScanReceipient
+ (NSDictionary*)mj_objectClassInArray
{
    return @{@"replies" : @"YWReply",
             @"receipientDetails" : @"YWMaterialStockOutDetail"};
}
@end


@implementation YWMaterialScanReturn
+ (NSDictionary*)mj_objectClassInArray
{
    return @{@"replies" : @"YWReply",
             @"details" : @"YWMaterialStockOut"};
}
@end
